import { createApp } from 'vue'

import router, { setupRouter } from '@/router'
import { setupDirective } from '@/directive'
import { setupStore } from '@/store'
import { registerGlobComp } from '@/components/registerGlobComp'

import App from '@/App.vue'

import 'nprogress/nprogress.css'
import 'animate.css'
import '@/styles/index.scss'

console.log('==环境变量==>', import.meta.env)

async function bootstrap() {
  const app = createApp(App)

  // 配置store
  setupStore(app)

  // 配置router
  setupRouter(app)

  // 注册全局组件
  registerGlobComp(app)

  // 注册全局指令
  setupDirective(app)

  await router.isReady()

  app.mount('#app')
}

bootstrap()
